FROM alpine:3.11

# 更换为阿里云的镜像源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 设置时区
ENV TZ=Asia/Shanghai
RUN apk add --no-cache tzdata

# 设置时区链接
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN mkdir -p /go/app
#设置工作路径
WORKDIR /go/app
#把上文编译好的main文件添加到镜像里
COPY ./app/miao /go/app/miao

RUN chmod +x /go/app/miao

#入口
ENTRYPOINT ["/go/app/miao"]
